//
//  ScreenshotsView.m
//  分享demo
//
//  Created by pc-chtypd056 on 2018/8/13.
//  Copyright © 2018年 CTL. All rights reserved.
//

#import "ScreenshotsView.h"

@interface ScreenshotsView()<XFXFAssistiveTouchDelegate>

@property (nonatomic,strong) UIButton *button;
@property (nonatomic,weak) XFAssistiveTouch *assistiveTouch;

@end

@implementation ScreenshotsView

- (instancetype)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {
        
        _button = [UIButton buttonWithType:UIButtonTypeCustom];
        _button.frame = CGRectMake(0, 0, 100, 50);
        [_button setTitle:@"测试" forState:UIControlStateNormal];
        [_button setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
        [self addSubview:_button];
        _button.center = self.center;
        [[_button rac_signalForControlEvents:UIControlEventTouchUpInside]subscribeNext:^(__kindof UIControl * _Nullable x) {
            [[Tools getCurrentViewController:self] toggleDebugger];
        }];
        
        XFAssistiveTouch *assistiveTouch = [XFAssistiveTouch sharedInstance];
        assistiveTouch.delegate = self;
        [assistiveTouch showAssistiveTouch];
        self.assistiveTouch = assistiveTouch;
        
    }
    return self;
}

- (NSInteger)numberOfItemsInViewController:(XFATViewController *)viewController{
    return 3;
}

- (XFATItemView *)viewController:(XFATViewController *)viewController itemViewAtPosition:(XFATPosition *)position{
    XFATItemView *view = [XFATItemView itemWithType:XFATItemViewTypeCount];
    view.backgroundColor = [UIColor redColor];
    return view;
}

- (void)viewController:(XFATViewController *)viewController didSelectedAtPosition:(XFATPosition *)position{
    
}

@end
